require 'note/note_controller.rb'

include ActionView::Helpers::TextHelper 

class SignalController < NoteController

  def event
    return render_rhtml_with_controller_layout(:index, "skeleton/layout")
  end

  def post
    # xxx the system should be smart enough to know that post.rhtml exists
    # xxx also the layout should be statically specifiable
    # xxx we have to decide if we are going to have the file system sit on the subdir or root...  
    return render_rhtml_with_controller_layout(:post, "skeleton/layout")
  end

  def statistics
    # xxx the system should be smart enough to know that post.rhtml exists
    # xxx also the layout should be statically specifiable
    # xxx we have to decide if we are going to have the file system sit on the subdir or root...  
    return render_rhtml_with_controller_layout(:statistics, "skeleton/layout")
  end

  def recent
    # xxx the system should be smart enough to know that post.rhtml exists
    # xxx also the layout should be statically specifiable
    # xxx we have to decide if we are going to have the file system sit on the subdir or root...  
    offset = params['offset'] || 0
    limit = params['limit'] || 20
    @notes = Note.find_by_sql("SELECT * FROM notes where notetype = 3 AND area = 1 ORDER BY uid DESC OFFSET #{offset} LIMIT #{limit}");
    return render_rhtml_with_controller_layout(:recent, "skeleton/layout")
  end

end

